<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="shiro" uri="/WEB-INF/ac.tld"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title> 工程表-列表</title>

<script src="${Config.staticURL}plugins/miniui/boot.js"
	type="text/javascript"></script>
<script type="text/javascript"
	src="${Config.staticURL}/lib/jquery/jquery.min.js"></script>


<style type="text/css">
html, body {
	margin-top: 0;
	padding: 0;
	border: 0;
	width: 99.3%;
	height: 100%;
	overflow: hidden;
}

a {
	color: #09f;
	text-decoration: none;
}
</style>
	
<body onKeyDown="javascript:search();">

			<div style="padding: 2px; border-bottom: 0; border: none; margin-top: 10px; background-color: #fff;">

				<table style="width: 100%; border: none;">
					<tr>

						<td style="width: 100%;">
							<shiro:hasPermission name="M0103-create">
								<a class="mini-button" iconCls="icon-add" onclick="addBusinessData()" plain="true" tooltip="增加...">增加</a>
							</shiro:hasPermission>
						</td>
						<td style="white-space: nowrap;">
				
																		<label style="font-family: Verdana;">父id: </label>
							<input class="mini-textbox" style="width: 150px;" name="parentId" id="parentId" />	
								
																								<label style="font-family: Verdana;">工程名称: </label>
							<input class="mini-textbox" style="width: 150px;" name="projectName" id="projectName" />	
								
																								<label style="font-family: Verdana;">线路工程名称: </label>
							<input class="mini-textbox" style="width: 150px;" name="lineProjectName" id="lineProjectName" />	
								
																								<label style="font-family: Verdana;">工程简称: </label>
							<input class="mini-textbox" style="width: 150px;" name="projectShortName" id="projectShortName" />	
								
																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																	<a class="mini-button mini-button-iconLeft" iconCls="icon-search" plain="true" onclick="query()">查询</a>
							
							<a class="mini-button mini-button-iconLeft" iconCls="icon-node" plain="true" onclick="exportExecl()">导出</a>
					
						</td>
					</tr>
			</table>
	</div>
			
<div class="mini-fit" style="">

	<div id="datagrid1" class="mini-datagrid" style="width: 100%; height: 100%;" allowSortColumn="false" allowCellWrap="false" ajaxOptions="{type : 'get'}" idField="id" sizeList="[10,20,30,40,50,100]" pageSize="20">
		<div property="columns">
			<div type="indexcolumn" width="50" headerAlign="center">序号</div>
									<div field="parent_id" width="200" headerAlign="center" allowSort="false" renderer="onActionRenderer">父id</div>
												<div field="project_name" width="200" headerAlign="center" allowSort="false">工程名称</div>
												<div field="line_project_name" width="200" headerAlign="center" allowSort="false">线路工程名称</div>
												<div field="project_short_name" width="200" headerAlign="center" allowSort="false">工程简称</div>
												<div field="project_code" width="200" headerAlign="center" allowSort="false">工程编码</div>
												<div field="zcb_project_name" width="200" headerAlign="center" allowSort="false">总承包工程群名称</div>
												<div field="project_style" width="200" headerAlign="center" allowSort="false">工程性质</div>
												<div field="project_type" width="200" headerAlign="center" allowSort="false">工程类型</div>
												<div field="v_grade" width="200" headerAlign="center" allowSort="false">电压等级</div>
												<div field="buile_style" width="200" headerAlign="center" allowSort="false">建设性质</div>
												<div field="tran_count" width="200" headerAlign="center" allowSort="false">变电容量</div>
												<div field="line_start" width="200" headerAlign="center" allowSort="false">线路起点</div>
												<div field="line_end" width="200" headerAlign="center" allowSort="false">线路终点</div>
												<div field="line_count" width="200" headerAlign="center" allowSort="false">线路条数</div>
												<div field="main_other_count" width="200" headerAlign="center" allowSort="false">主配变台数</div>
												<div field="totle_money" width="200" headerAlign="center" allowSort="false">总投资额</div>
												<div field="tran_money" width="200" headerAlign="center" allowSort="false">变电投资额</div>
												<div field="line_money" width="200" headerAlign="center" allowSort="false">线路投资额</div>
												<div field="project_state" width="200" headerAlign="center" allowSort="false">工程状态</div>
												<div field="is_big_cross_project" width="200" headerAlign="center" allowSort="false">是否大跨越工程</div>
												<div field="is_perfect_project" width="200" headerAlign="center" allowSort="false">是否创优工程</div>
												<div field="is_import_project" width="200" headerAlign="center" allowSort="false">是否重点工程</div>
												<div field="plan_start_time" width="200" headerAlign="center" allowSort="false">计划开工日期</div>
												<div field="plan_fininsh_time" width="200" headerAlign="center" allowSort="false">计划竣工日期</div>
												<div field="pan_used_time" width="200" headerAlign="center" allowSort="false">计划投产日期</div>
												<div field="build_point" width="200" headerAlign="center" allowSort="false">建设地点</div>
												<div field="build_addr" width="200" headerAlign="center" allowSort="false">建设地址</div>
												<div field="manager_org" width="200" headerAlign="center" allowSort="false">总承包业主单位</div>
												<div field="manager" width="200" headerAlign="center" allowSort="false">业主项目经理</div>
												<div field="tel" width="200" headerAlign="center" allowSort="false">业主联系电话</div>
												<div field="group_id" width="200" headerAlign="center" allowSort="false">工程附件资料</div>
												<div field="yz_org" width="200" headerAlign="center" allowSort="false">业主单位</div>
												<div field="jl_org" width="200" headerAlign="center" allowSort="false">监理单位</div>
												<div field="sg_org" width="200" headerAlign="center" allowSort="false">施工单位</div>
												<div field="project_intrduce" width="200" headerAlign="center" allowSort="false">工程概况</div>
												<div field="trade_person" width="200" headerAlign="center" allowSort="false">录入人</div>
												<div field="trade_time" width="200" headerAlign="center" allowSort="false">录入时间</div>
												<div field="delete_flag" width="200" headerAlign="center" allowSort="false">删除标记位,0未删除，1已删除</div>
												<div field="remark" width="200" headerAlign="center" allowSort="false">备注</div>
												<div field="line_length" width="200" headerAlign="center" allowSort="false">线路长度</div>
												<div field="sj_org" width="200" headerAlign="center" allowSort="false">设计单位</div>
												<div field="is_project" width="200" headerAlign="center" allowSort="false">0：总承包工程，1：分工程</div>
									</div>
		</div>

	</div>		


<script type="text/javascript">
		var basePath = '${Config.baseURL}';
		var WinAlerts = window.alert;
	    window.alert = function (e) {
	        if (e != null && e.indexOf("提示内容") > -1) {
	            //和谐了
	        }
	        else {
	            WinAlerts(e);
	        }
	
	    };
	
	
	    mini.parse();
	    var grid = mini.get("datagrid1");
	    grid.setUrl("${Config.basePath}epc/demo/getDemoListByPage");
	    grid.load();
	    //添加链接
	    function onActionRenderer(e) {
	        var grid = e.sender;
	        var record = e.record;
	        var uid = record._uid;
	        var rowIndex = e.rowIndex;
	        						return '<a href="javascript:goToInfo(\'' + record.id + '\')">' + record.parent_id + '</a>';
																																																																																																																																																																																																																			    }
	    
	    //跳转添加页面
	    function addBusinessData() {
	    	var url = basePath + "view/epc/demo/demoAdd";
	        window.location.href = url;
	    }
	    //跳转详细页面
	    function goToInfo(id) {
	   		var url = basePath + "view/epc/demo/demoInfo?id=" + id;
	        window.location.href = url;
	    }
	    
	    
	     						var parentId = mini.get("parentId").getValue();
											var projectName = mini.get("projectName").getValue();
											var lineProjectName = mini.get("lineProjectName").getValue();
											var projectShortName = mini.get("projectShortName").getValue();
																																																																																																																																																																																																				    //查询功能
	    function query() {
	   
	    grid.load({
			parentId: parentId, projectName: projectName, lineProjectName: lineProjectName,  projectShortName: projectShortName                                      			});
	    }
	
	
	    //回车检索功能
	    function search() {
	        if (window.event.keyCode == 13) { //enter
	            query();
	        }
	
	    }
	     //导出Execl
	    function exportExecl() {
	    	var url = basePath+'demo/getDownloadFile';
	       	window.location.href=url;
	    }
</script>
</body>
</html>